#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char *argv[])
{
    int count;
    char query[500];
    count = 0;
    while(count < 10)
    {
        count++;

        gets(query);

        printf("char: %c, key = %d, length = %d\n", query[0], query[1], strlen(query));

        if(query[0] == 'q' || query[0] == 'Q')
        {
            printf("cmd: %s\n",query);
            break;
        }
    }

    return 0;
}
